package main

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/logs"
	"github.com/astaxie/beego/orm"
	"kitalk/models"
	"github.com/zw2582/zm_go_lib/helpers"
	_ "kitalk/routers"
)

func main() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"

	} else {
		//设置文件日志
		logs.GetBeeLogger().DelLogger("console")
		helpers.LogFileConfig()

	}

	//初始化数据库
	models.DbConfig()

	orm.RunCommand()

	beego.Run()
}
